<%= render 'base' %>
<% content_for :breadcrumb do %>
	<% if @node.blank? %>
	  <li>首页</li>
  <% else %>
    <li><%= @node.name %></li>
	<% end %>
<% end %>
<%= render 'sidebar' %>

<div class="content">
	<div class="box">
    <% if !@node.blank? %>
    <div id="node_info">
      <p>
        <h1><%= @node.name %></h1>
        <span class="total">共有 <%= @node.topics_count %> 个讨论主题</span>
      </p>
    </div>
    <% else %>
      <h1><%= Setting.app_name %></h1>
    <% end %>
    <div class="topics">
	 <%= render :partial => "topic", :collection => @topics %>
    </div>
      
    <% if params[:action] == "index" %>
      <div class="more">
        <a href="<%= recent_topics_path %>">查看更多最近发布的帖子...</a>
      </div>
    <% elsif params[:action] == "node" or params[:action] == "search" %>
      <%= will_paginate @topics %>
    <% end %>
	</div>
	<% if params[:action] == "index" %>
	<div id="sections" class="box">
	<h2>节点分类导航</h2>
	<ul>
		<% @sections.each do |section| %>
		<li>
			<label><%= section.name %></label>
			<% section.nodes.each do |node| %>
			<a href="<%= node_topics_path(node.id) %>" title="<%= node.name %>"><%= node.name %></a>
			<% end %>
		</li>
		<% end %>
	</ul>
	</div>
	<% end %>
</div>

